/**
 *   @author Giulio Rossetti <Giulio.Rossetti@gmail.com>
 *   @version 1.0 31\05\2009
 *
 *   This file is part of "HotSpot Locator".
 *
 *   "HotSpot Locator" is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   "HotSpot Locator" is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package HotSpotLocator;

import com.eightmotions.map.*;
import javax.microedition.lcdui.Display;

/**
 * @author Giulio Rossetti <Giulio.Rossetti@gmail.com>
 * @version 1.0 31\05\2009
 */
public class TrackFetcher extends Thread implements TrackNotifier {

    private Display m_display;
    private MapDisplay m_map;

    public TrackFetcher(Display m_display, MapDisplay m_map){
        this.m_display = m_display;
        this.m_map = m_map;
    }

    public void run(){
        Track track=Track.getTrack(m_display,"http://www.mgmaps.com/fon/kml.php","Carico i dati...",m_map);
        track.setNotifier(this);
    }

    public void onTrackLoaded(Track tr) {
        m_map.displayTrack(tr,true);
    }

    public void onTrackCreated(Track tr) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void onTrackSaved(Track tr) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}